package riot.challenge.java.model;

import java.util.ArrayList;
import java.util.List;

import riot.challenge.java.interfaces.IAchievement;
import riot.challenge.java.interfaces.IHistoricalPlayerStatistics;

public class Player {

	private String name;
	private IHistoricalPlayerStatistics historicalStats;
	private List<IAchievement> achivementList;
	
	public Player() {
		
		this.name = "";
		this.historicalStats = null;
		this.achivementList = new ArrayList<IAchievement>();
	}
	
	public Player(String name, IHistoricalPlayerStatistics historicalStats) {
		
		this.name = name;
		this.historicalStats = historicalStats;
		this.achivementList = new ArrayList<IAchievement>();
	}
	
	public String getName(){
		
		return this.name;
	}
	
	public void setName(String name){
		
		this.name = name;
	}
	
	public IHistoricalPlayerStatistics getHistoricalStats() {
		
		return this.historicalStats;
	}
	
	public List<IAchievement> getAchievementList(){
		
		return this.achivementList;
	}
	
	public void clearAchievementList() {
		
		if(this.achivementList != null) 
			this.achivementList.clear();
		else
			this.achivementList = new ArrayList<IAchievement>();
	}
	
	public void addAchievement(IAchievement newAchievement) {
		
		if(this.achivementList != null) {
			
			this.achivementList.add(newAchievement);
		} else {
			
			this.achivementList = new ArrayList<IAchievement>();
			this.achivementList.add(newAchievement);
		}		
	}
	
}
